<div align="center">
<% if logged_in? -%>



  <div id="user-bar-greeting">hello,   <% @user = User.find(current_user.id) %>
  
  <%= link_to h(@user.login), @user %>! </b> (<%= link_to "Log out", logout_path, { :title => "Log out" }    %>)

  

  <p>
  <%if @user.userpic.filename != nil%>
  <%= link_to image_tag(@user.userpic.public_filename, :alt => 'foo', :height => '100', :border => '1'), @user %><%#= image_tag @user.userpic.public_filename, :alt => 'foo' %>
  <!--<img width="100" src="<%= @user.userpic.public_filename %>" border="1">-->
  <%else%>
  <%= link_to image_tag("smiley.jpg", :alt => 'foo', :width => '100', :border => '1'), @user  %>
    
  <%end%>
  <br>
  </p>
  </div>

<% else -%>

  <% form_tag session_path do -%>


<table border="0"><tr><td><%= label_tag 'login' %></td><td><%= text_field_tag 'login', @login %></td></tr>

    <tr><td><%= label_tag 'password' %></td><td><%= password_field_tag 'password', nil %></td></tr>
<tr><td><%= label_tag 'remember_me', 'Remember me' %></td><td><%= check_box_tag 'remember_me', '1', @remember_me %> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <%= submit_tag 'Log in' %></td></tr>
<tr><td></td><td><center></td></tr>
<tr><td></td><td>New user? <%= link_to "Sign up!", signup_path(:anchor => 'signup'), { :title => "Create an account" } %>
</table>


</form>  <!--<div id="user-bar-greeting"><a href="/login" style="border: none;" title="127.0.0.1">Not logged in</a></div>-->
  
  <% end -%>
  <!--<div id="user-bar-greeting"><%= link_to_login_with_IP 'Not logged in', :style => 'border: none;' %></div>-->
  <div id="user-bar-action"  ><!--<%= link_to "Log in",  login_path,  { :title => "Log in" } %> /-->
                               </div>
<% end -%>
</div>



  